firstStrategy <- function() {
  # to what symbols are the filter rule to be tested
  groups <- c("SMALL_CAPS", "DJI_STOCKS")
  groupinfo <- getDBGroup(groups)
  
  # what filter rules to apply
  # this example: (buy) ADXgt25 DIpgt CltSMA200 CltSMA50 BlackMarubozu
  for(i in 1:nrow(groupinfo)) {
    if (getSymbols(toString(groupinfo[i,'stock_id']), src='vadbID', datefrom=groupinfo[i,'from']) != groupinfo[i,'code']) {
      stop("code does not match") 
    } else {
      symcode <- paste(groupinfo[i,'code'], ".vadb", sep="")
      AS <- ADXStatus(get(symcode))
      SMA50 <- SMAStatus(get(symcode), n=50)
      SMA200 <- SMAStatus(get(symcode), n=200)  
      CSPS <- CSPStatus(get(symcode), "MARUBOZU")
      FILTERED <- AS[,'ADXgt25'] & AS[,'DIpgt'] & SMA50[,'CltSMA50'] & SMA200[,'CltSMA200'] & CSPS[,"BlackMarubozu"]
      last <- tail(FILTERED, n=1)
      if (last[1,1] > 0) {
        cat(symcode, "is true for", toString(index(last[1,])), "\n")
      } else {
        cat(symcode, "is false for", toString(index(last[1,])), "\n")        
      }
    }
  }
}
